package com.quanquan.service.impl;

import com.quanquan.entity.StudentInfo;
import com.quanquan.repository.LessonInfoRepository;
import com.quanquan.repository.StudentInfoRepository;
import com.quanquan.service.LessonInfoService;
import com.quanquan.service.StudentInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


@Service
public class StudentInfoServiceImpl implements StudentInfoService {

    @Autowired
    private StudentInfoRepository studentInfoRepository;

    public StudentInfo findByMobile(String mobile) {
        return studentInfoRepository.findByMobile(mobile);
    }

    public StudentInfo findById(Long id) {
        return studentInfoRepository.findById(id);
    }

    @Override
    public void save(StudentInfo user) {
        studentInfoRepository.save(user);
    }

    public List<StudentInfo> getStudentInfoList() {
        return studentInfoRepository.findAll();
    }

    public List<StudentInfo> findByOnline(String online) {
        return studentInfoRepository.findByOnline(online);
    }

    public StudentInfo findByToken(String token) {
        return studentInfoRepository.findByToken(token);
    }

    public List<StudentInfo> findByGrade(String grade) {
        return studentInfoRepository.findByGrade(grade);
    }
}


